﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace SmartFactory.Controllers
{
    /// <summary>
    /// 物料管理控制器
    /// </summary>
    public class MaterialsController : Controller
    {
        private readonly IpAddressesConfig _ipAddressesConfig;

        public MaterialsController(IOptions<IpAddressesConfig> ipAddressesConfig)
        {
            _ipAddressesConfig = ipAddressesConfig.Value;
        }
        /// <summary>
        /// 显示物料管理页面
        /// </summary>
        /// <returns>返回物料管理页面</returns>
        public IActionResult MaterialsInfoView()
        {
            ViewBag.Darius = _ipAddressesConfig.Darius;
            ViewBag.Durian = _ipAddressesConfig.Durian;
            ViewBag.GlennQuigmrire = _ipAddressesConfig.GlennQuigmrire;
            ViewBag.Keep = _ipAddressesConfig.Keep;
            ViewBag.GoldIngot = _ipAddressesConfig.GoldIngot;
            return View();
        }


        /// <summary>AddForm
        /// 显示物料添加弹窗视图
        /// </summary>
        /// <returns>返回物料添加弹窗视图</returns>
        public IActionResult AddFormView()
        {
            ViewBag.Darius = _ipAddressesConfig.Darius;
            ViewBag.Durian = _ipAddressesConfig.Durian;
            ViewBag.GlennQuigmrire = _ipAddressesConfig.GlennQuigmrire;
            ViewBag.Keep = _ipAddressesConfig.Keep;
            ViewBag.GoldIngot = _ipAddressesConfig.GoldIngot;
            return View();
        }

        /// <summary>
        /// 显示物料添加查询产品弹框内容视图
        /// </summary>
        /// <returns>返回物料添加查询产品弹框内容视图</returns>
        public IActionResult MaterialsProductsView()
        {
            ViewBag.Darius = _ipAddressesConfig.Darius;
            ViewBag.Durian = _ipAddressesConfig.Durian;
            ViewBag.GlennQuigmrire = _ipAddressesConfig.GlennQuigmrire;
            ViewBag.Keep = _ipAddressesConfig.Keep;
            ViewBag.GoldIngot = _ipAddressesConfig.GoldIngot;
            return View();
        }





    }
}
